package org.pragma;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import org.pragma.external.PragmaAssign;
import org.pragma.external.PragmaCreateInstance;
import org.pragma.external.PragmaCreateClass;
import org.pragma.external.PragmaIf;
import org.pragma.external.PragmaPrint;
import org.pragma.objects.PragmaObject;



public class PragmaRootClass extends PragmaClass {

	static PragmaRootClass root = new PragmaRootClass();
	
	public static PragmaRootClass getInstance(){
		return root;
	}

	public PragmaRootClass() {
		super("root");
		
		add(new PragmaIf());
		add(new PragmaPrint());
		add(new PragmaAssign());
		add(new PragmaCreateInstance());
		add(new PragmaCreateClass());
		
		/*Method[] ms = this.getClass().getDeclaredMethods();
		for(int i=0,n=ms.length;i<n;i++){
			externalMethods.put(ms[i].getName(),ms[i]);
		}*/
		
	}
	
	
	
	/*
	
	
	public PragmaObject displayMe(){
	
		return null;
	}
	
	public PragmaObject displayMe2(String s){
		
		return null;
	}
	
	public static void main(String[] args) {
		PragmaRootClass pr = new PragmaRootClass();
		PragmaContext ctx = new PragmaContext();
		try {
			pr.executeMethod(pr, "displayMe",(Object[])null);
			Object[] objs = {"2"};
			pr.executeMethod(ctx,pr, "displayMe2",objs);
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (InvocationTargetException e) {
			e.printStackTrace();
		}
	}
	 */
}
